// 账号管理
import request from "@/utils/request";

// 暴露请求函数
// 登录的接口方法

export const reqcreateAccountList = (params) => {
  return request({
    url: "http://localhost:9527/createAccount",
    method: "post",
    data: params,
  });
};
// 查询
export const reqGetAccountList = (params) => {
  return request({
    url: "http://localhost:9527/account",
    method: "get",
    params,
  });
};
// 搜索
export const reqQueryAccountList = (params) => {
  return request({
    url: `http://localhost:9527/account?keyword=${params.name}`,
    method: "get",
    params,
  });
};
//更改用户状态
export const reqEditAccountList = ({ id }, params) => {
  return request({
    url: `http://localhost:9527/updateAccount/${id}`,
    method: "put",
    data: params,
  });
};
export const reqEditAccount = (params) => {
  console.log("params", params);
  return request({
    url: `http://localhost:9527/update/${params}`,
    method: "post",
    data: params,
  });
};
// 删除;
export const reqDeleteAccountList = ({ id }) => {
  return request({
    url: `http://localhost:9527/account/${id}`,
    method: "DELETE",
  });
};
